import { NModal, ModalProps } from 'naive-ui';
import OceanComponent from './OceanComponent';

interface IModal {
  open();
  close();
}

class Modal extends OceanComponent<ModalProps & { 'on-update:show'?: Function }> implements IModal {
  isOceanComponent: boolean = false;
  constructor(attrs?: ModalProps) {
    super(NModal, attrs, {
      show: false,
      'on-update:show': (v: boolean) => (this.attrs.show = v)
    });
  }
  open() {
    this.attrs.show = true;
  }
  close() {
    this.attrs.show = false;
  }
}

export default Modal;
